package com.gcsoftware.web.mapper.providers;

import com.gcsoftware.web.beans.T_GW_INTERF_PARAMS;
import org.apache.ibatis.annotations.Param;

import java.text.MessageFormat;
import java.util.List;

/**
 * Created by qs on 2018/4/3.
 */
public class InterfsProvider {
    public String batchDelIparams ( @Param(value = "iparamsList") List<T_GW_INTERF_PARAMS> iparamsList) {
        StringBuilder builder = new StringBuilder();
        builder.append("DELETE T_GW_INTERF_PARAMS ");
        builder.append("WHERE c_IPARAMS_ID in (");
        MessageFormat fmt = new MessageFormat("#'{'iparamsList[{0}].c_IPARAMS_ID}");
        for (int i =0; i<iparamsList.size(); i++) {
            builder.append(fmt.format(new Object[]{i}));
            if (i < iparamsList.size() - 1) {
                builder.append(",");
            }
        }
        builder.append(")");
        return builder.toString();
    }

}
